<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = ['red', 'green', 'blue'];
      arr[3] = 'pink';		// 新增元素
      console.log(arr);	// (4) ["red", "green", "blue", "pink"]
      arr[0] = 'yellow';	// 修改元素
      console.log(arr);	// (4) ["yellow", "green", "blue", "pink"]
    </script>
  </body>
</html>